package com.bys.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class PayController {
    @Value("${server.port}")
    private String serverPort;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @GetMapping("/pay/byId/{payId}")
    public String getById(@PathVariable Integer payId){
        String data = stringRedisTemplate.boundValueOps(String.valueOf(payId)).get();
        return data + "*** 服务端口：" + serverPort;
    }
}
